package com.qrpay.model.enums;

/**
 * 异步支付（网银）返回方法类型
 */
public enum AsyncRespMethodType {

    Get("Get", "Get请求"),
    Post("Post", "Post请求"),
    QrCode("QrCode", "二维码"),
    ;

    private final String code;
    private final String desc;

    AsyncRespMethodType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public boolean equals(String code) {
        return this.code.equals(code);
    }

    public static AsyncRespMethodType byCode(String code) {
        for (AsyncRespMethodType t : values()) {
            if (t.equals(code)) return t;
        }
        return null;
    }
}
